type TeacherApi = {
  getList: (pageIndex:number, pageSize:number) => Promise<any>;
  add: (opts:any) => Promise<any>;
  getDetail: (id:number) => Promise<any>;
  put: (id:number,opts: any) => Promise<any>;
}

export default <TeacherApi> {
  // get请求
  // ?scope=generic&pageSize=300&sortField=id&sortOrder=DESC
  add: async (opts: any) => await getFetchData('/teacher','post',opts),
  getList: async (pageIndex:number=1, pageSize:number=10) => await getFetchData('/teacher/list','get',{pageIndex, pageSize}),  
  getDetail: async (id:number) => await getFetchData('/teacher?id=' + id,'get'),
  put: async (id:number,opts: any) => await getFetchData('/teacher?id=' + id,'put', opts),
}